/**
 * 
 * @authors Riche
 * @date    2016-07-05 10:39:22
 * @version 1.1.0
 */





var info=new Vue({
  el:"#app",
  data:{
    scrollbar:{},
    data:[],
    isLoading:true,
    pageIndex :1,
    pageSize : PAGESIZE
  },
  created:function(){
      var dtd = $.Deferred();
      var _self = this;
      //列表
      var data = {
          pageSize: _self.pageSize,
          pageIndex:_self.pageIndex
      };
      data = Common.jsonEncode(data);
      _self.scrollbar = new scrollBar({
          isLoading: _self.isLoading,
          url: "user_getKnowledgeDynamic",
          type:"get",
          data:data
      });
      
      _self.loadlist();
      
  },
  compiled:function(){
    $(document).scroll(function () {
      if ($(document).scrollTop() >= $(document).height() - $(window).height()) {
          info.loadlist(function(){
          });
      }
    }); 

  },
  methods:{
    loadlist:function(callback){

      var _self = this;

      _self.scrollbar.load(function(pageIndex,data){
        for(var i = 0; i < data.length; i++){
          
          _self.data.push(data[i]);
        }
        _self.pageIndex = pageIndex;
      },function(isLoading){
        _self.isLoading = isLoading;
      });
      
    },
    loadPhoto:function(){
      // 比例
      myJS.imgScale('.j_4', '4', '3');
      myJS.ImgFull('.loadImg','images/liby.png');
    }

  },
  watch:{
  }

});



